# coding=utf-8
import os;
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "web.settings")  # NoQA
import django;
django.setup()  # NoQA

from auto_sale.models import *
# import auto_sale.models as am
import logging
logging.basicConfig(level=logging.INFO)

class CleanDataController():

    # 为什么这里不行
    def clean_all_product_data(self):
        product_list = Product.objects.all()
        for product in product_list:
            print product.name
        # am.Product.objects.all().delete()
        # Product.objects.all().delete()
        # Inventory.objects.all().delete()
        # Size.objects.all().delete()
        # Color.objects.all().delete()
        # BoothImage.objects.all().delete()
        # DetailImage.objects.all().delete()
        # Product.objects.all().delete()
        logging.info('删除完成')

if __name__ == '__main__':
    clean_data_controller = CleanDataController()
    clean_data_controller.clean_all_product_data()